﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CustomerProductInfo.aspx.vb" Inherits="Map.CustomerProductInfo" %>
<%@ Register TagPrefix="mnu" Namespace="Mysoft.Map.Application.Menus" Assembly="Mysoft.Map.Application.Components" %>
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Map.Application.Controls" Assembly="Mysoft.Map.Application.Components" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    	<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
		<link rel="stylesheet" type="text/css" href="/_nav/menu.css">
		<link rel="stylesheet" type="text/css" href="/_nav/tabs.css">
		<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
		
		<script language="javascript" src="/_common/scripts/global.js"></script>
		<script language="javascript" src="/_common/scripts/Details.js"></script>
		<script language="javascript" src="/_controls/settings.aspx"></script>
		<script language="javascript" src="/_controls/util/util.js"></script>
		<script language="javascript" src="/_nav/menu.js"></script>
		<script language="javascript" src="/_forms/FormBase.js"></script>    
		
		<%--日志管理系统的公用JS--%>
        <script src="Js/LMSCommon.js" type="text/javascript"></script> 		
</head>

<body MS_POSITIONING="GridLayout" style="padding:10px;" onload="window_onload()">
    <form id="Form1" runat="server" method="post" enableviewstate="false">
        <asp:Literal ID="Content" runat="server"></asp:Literal>
    </form>
		<table style="FONT-SIZE: 9pt;" height="100%" cellSpacing="0" cellPadding="0" width="100%">
			<tr height="1">
				<td>
					<mnu:AppFormMenu id="appFormMenu" runat="server"></mnu:AppFormMenu>
				</td>
			</tr>
			<tr>
				<td style="height:5px">
					&nbsp;
				</td>
			</tr>
			<tr>
				<td>
					<cnt:AppForm id="appForm" runat="server" processtype="xmlhttp" onaftersave="oprAfterSave()"></cnt:AppForm>
				</td>
			</tr>			
		</table>
</body>
</html>

<script type="text/javascript" >
    //页面初始化
    function window_onload() 
    {
        HideMenu();
        appForm._bAlert = false;

        //初始化界面中的数据。
        InitDefaultValue();
    }

    //通过后台读数据库中信息发送到前端，采用JS前端初始化界面中的数据。
    function InitDefaultValue() {
        var xmlDom = XMLDOM();
        xmlDom.loadXML(__xml);
        if (xmlDom.parseError.errorCode != 0) return "";

        var node = xmlDom.documentElement.selectSingleNode("/Lms_CustomerProductInfo/Customer")
        if (node != undefined && appForm.Customer) 
        {
            appForm.Customer.setValue(node.text);
        }

        node = xmlDom.documentElement.selectSingleNode("/Lms_CustomerProductInfo/Product")
        if (node != undefined && appForm.Product) 
        {
            appForm.Product.setValue(node.text);
        }
    }

    // 保存完毕返回后触发事件
    // 可以通过 appForm.returnxml 取到返回值
    // 通过设置 event.returnValue = true/false 确定是否需要系统自动处理后续步骤
    function oprAfterSave() 
    {
        var xmlDom = XMLDOM();
        xmlDom.loadXML(appForm.returnxml);
        
        if (xmlDom.parseError.errorCode != 0) return "";

        if (xmlDom.documentElement.attributes.getNamedItem("result").value == "true") 
        {
            alert("保存信息成功！");
        }
        else 
        {
            alert("保存信息不成功：" + xmlDom.documentElement.attributes.getNamedItem("errormessage").value);
        }
    }    
</script>